build-aux: fallback to default glib-compile-schemas & gio-querymodules.
authorJehan <jehan@girinstud.io>
Sun, 28 Jun 2020 10:48:27 +0000 (12:48 +0200)
committerJehan <jehan@girinstud.io>
Sun, 28 Jun 2020 10:48:27 +0000 (12:48 +0200)
The pkg-config variables have been added in GLib 2.62.0. Let's fallback
to default names for these tools in such case (`pkg-config` still
returns a 0 return value, but with empty output for absent variables).

build-aux/meson/post-install.py

index 4a4cc02fc4b9599a02c858e0f5e2ebd14a4ce6a2..7616de7ba269ce3e4849d079a168a9e7c1d80566 100644 (file)
@@ -18,6 +18,9 @@ if 'DESTDIR' not in os.environ:
     glib_compile_schemas = subprocess.check_output(['pkg-config',
                                                    '--variable=glib_compile_schemas',
                                                    'gio-2.0']).strip()
+    if not os.path.exists(glib_compile_schemas):
+        # pkg-config variables only available since GLib 2.62.0.
+        glib_compile_schemas = 'glib-compile-schemas'
     subprocess.call([glib_compile_schemas,
                     os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])\r
 \r
@@ -30,6 +33,9 @@ if 'DESTDIR' not in os.environ:
     gio_querymodules = subprocess.check_output(['pkg-config',
                                                 '--variable=gio_querymodules',
                                                 'gio-2.0']).strip()
+    if not os.path.exists(gio_querymodules):
+        # pkg-config variables only available since GLib 2.62.0.
+        gio_querymodules = 'gio-querymodules'
     subprocess.call([gio_querymodules, gtk_printmodule_dir])
 \r
     print('Updating module cache for input methods...')\r